#include <iostream>
using namespace std;


int* getRow(int rowIndex, int* returnSize) {
    *returnSize = rowIndex + 1;
    int* ans = (int*)calloc(*returnSize, sizeof(int));
    ans[0] = 1;
    int i = 0;
    int j = 0;
    for (i = 1; i <= rowIndex; i++)
    {
        for (j = i; j > 0; j--)
        {
            ans[j] += ans[j - 1];
        }
    }
    return ans;
}

int main()
{
    int size = 0;
    int row = 3;
    int* ret = getRow(3, &size);
    for (int i = 0; i < size; i++)
    {
        cout << ret[i] << " " << endl;
    }
    return 0;
}